<?php
class DataBaseConnection
{
	public $pdo;
	private $dsn, $username, $password, $options;

	public function __construct($dsn, $username, $password, $options)
	{
		$this->dsn = $dsn;
		$this->username = $username;
		$this->password = $password;
		$this->options = $options;
		$this->connect();
	}

	private function connect()
	{
		$this->pdo = new PDO($this->dsn, $this->username, $this->password, $this->options);
	}

	public function __sleep()
	{
		return array('dsn', 'username', 'password');
	}

	public function __wakeup()
	{
		$this->connect();
	}
}